package com.ruoyi.factorydata.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.factorydata.domain.InventoryReceiptModelDetail;
import com.ruoyi.factorydata.mapper.InventoryReceiptModelDetailMapper;
import com.ruoyi.factorydata.service.IInventoryReceiptModelDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 母版入库单详情Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-26
 */
@Service
public class InventoryReceiptModelDetailServiceImpl extends ServiceImpl<InventoryReceiptModelDetailMapper, InventoryReceiptModelDetail> implements IInventoryReceiptModelDetailService {
    private final InventoryReceiptModelDetailMapper inventoryReceiptModelDetailMapper;

    public InventoryReceiptModelDetailServiceImpl(InventoryReceiptModelDetailMapper inventoryReceiptModelDetailMapper) {
        this.inventoryReceiptModelDetailMapper = inventoryReceiptModelDetailMapper;
    }

    /**
     * 查询母版入库单详情
     *
     * @param id 母版入库单详情主键
     * @return 母版入库单详情
     */
    @Override
    public InventoryReceiptModelDetail selectInventoryReceiptModelDetailById(Long id) {
        return inventoryReceiptModelDetailMapper.selectInventoryReceiptModelDetailById(id);
    }

    /**
     * 查询母版入库单详情列表
     *
     * @param inventoryReceiptModelDetail 母版入库单详情
     * @return 母版入库单详情
     */
    @Override
    public List<InventoryReceiptModelDetail> selectInventoryReceiptModelDetailList(InventoryReceiptModelDetail inventoryReceiptModelDetail) {
        return inventoryReceiptModelDetailMapper.selectInventoryReceiptModelDetailList(inventoryReceiptModelDetail);
    }

    /**
     * 新增母版入库单详情
     *
     * @param inventoryReceiptModelDetail 母版入库单详情
     * @return 结果
     */
    @Override
    public int insertInventoryReceiptModelDetail(InventoryReceiptModelDetail inventoryReceiptModelDetail) {
                inventoryReceiptModelDetail.setCreateTime(DateUtils.getNowDate());
            return inventoryReceiptModelDetailMapper.insertInventoryReceiptModelDetail(inventoryReceiptModelDetail);
    }

    /**
     * 修改母版入库单详情
     *
     * @param inventoryReceiptModelDetail 母版入库单详情
     * @return 结果
     */
    @Override
    public int updateInventoryReceiptModelDetail(InventoryReceiptModelDetail inventoryReceiptModelDetail) {
                inventoryReceiptModelDetail.setUpdateTime(DateUtils.getNowDate());
        return inventoryReceiptModelDetailMapper.updateInventoryReceiptModelDetail(inventoryReceiptModelDetail);
    }

    /**
     * 批量删除母版入库单详情
     *
     * @param ids 需要删除的母版入库单详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryReceiptModelDetailByIds(Long[] ids) {
        return inventoryReceiptModelDetailMapper.deleteInventoryReceiptModelDetailByIds(ids);
    }

    /**
     * 删除母版入库单详情信息
     *
     * @param id 母版入库单详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryReceiptModelDetailById(Long id) {
        return inventoryReceiptModelDetailMapper.deleteInventoryReceiptModelDetailById(id);
    }
}